package test;

import java.io.File;

import com.docman.domainmodel.Constants;

public class deleteFile {

	
	public static void main(String[] args) {
		//file: asd.txt
        String filePath = Constants.filePath+"\\"+"Innova Formatli_cv.doc";
        
        File deleteFile = new File(filePath);
        
        boolean fileDeleteSuccess;
        
        if (!deleteFile.exists())
            throw new IllegalArgumentException(
                "Delete: no such file or directory: " + filePath);

          if (!deleteFile.canWrite())
            throw new IllegalArgumentException("Delete: write protected: "
                + filePath);
          
          fileDeleteSuccess  = deleteFile.delete();
          
          if (!fileDeleteSuccess)
              throw new IllegalArgumentException("Delete: deletion failed");
          else
        	  System.out.println("File Succesfully deleted");
          
	}

}
